Feat/raae 1322/hybrid support#639
Conversation
Adds tests/integration/test_sql_redis_hybrid.py exercising hybrid_vector_search() through SQLQuery against a native FT.HYBRID command (RRF and LINEAR fusion, WHERE filter, redis_query_string inspection, sync + async). Version-gated with skip_if_redis_version_below(..., "8.4.0") and a redis-py>=7.1.0 skipif, matching test_hybrid.py. Adds a "Hybrid search (FT.HYBRID)" example cell to the SQL-to-Redis user guide and a packaging spec under docs/proposals/. Requires sql-redis with hybrid support. Jira: RAAE-1322
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 69df859. Configure here.
There was a problem hiding this comment.
Pull request overview
This PR updates RedisVL’s optional SQLQuery integration to support server-side hybrid fusion (FT.HYBRID) by bumping the sql-redis extra to >=0.7.0, adding a new integration test suite for hybrid SQL queries, and updating user-facing documentation/spec materials.
Changes:
- Bump optional dependency
sql-redis(andallextra) from>=0.6.0to>=0.7.0. - Add integration tests validating
hybrid_vector_search(...)execution andredis_query_string()rendering forFT.HYBRID(sync + async). - Update docs with a new SQL user-guide section and a draft proposal/spec for SQLQuery hybrid support.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/integration/test_sql_redis_hybrid.py | Adds integration coverage for SQLQuery hybrid fusion via FT.HYBRID (including async). |
| pyproject.toml | Bumps sql-redis optional dependency minimum version to >=0.7.0 (and in all). |
| docs/user_guide/12_sql_to_redis_queries.ipynb | Adds a “Hybrid search (FT.HYBRID)” section with an example using hybrid_vector_search(...). |
| docs/proposals/sqlquery-ft-hybrid.md | Introduces a draft spec describing SQLQuery hybrid fusion support and expected behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """, params={"vec": embedding_bytes}) | ||
| ``` | ||
|
|
||
| Requires Redis 8.4+ and `redis-py >= 7.1.0`. |
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "source": "### Hybrid search (FT.HYBRID)\n\nUse `hybrid_vector_search()` to fuse a full-text query and a vector query into a single ranking **server-side** with Redis's native `FT.HYBRID`. It composes the `cosine_distance()` (vector leg) and `fulltext()` (text leg) functions, with `rrf()` or `linear()` selecting the fusion method (reciprocal rank fusion or a linear weighting).\n\nThis differs from the *pre-filter* hybrid search above (a `WHERE` clause narrowing a KNN search): here both legs are ranked independently and fused, rather than text acting only as a filter.\n\n> Requires Redis 8.4+ and `redis-py >= 7.1.0`.", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| - ``hybrid_vector_search(cosine_distance(field, :vec), fulltext(field, 'query'), rrf())`` fuses a text and a vector query server-side via Redis ``FT.HYBRID`` | ||
| (requires ``sql-redis >= 0.7.0``, Redis 8.4+, and redis-py >= 7.1.0). Use | ||
| ``rrf()`` or ``linear()`` to select the fusion method |
| .. note:: | ||
| SQLQuery supports hybrid search via ``hybrid_vector_search(cosine_distance(...), fulltext(...), rrf())``, which translates to a native Redis ``FT.HYBRID`` command | ||
| fusing a text and a vector query server-side. This is the SQL front-end to | ||
| :class:`HybridQuery` and requires ``sql-redis >= 0.7.0``, Redis 8.4+, and | ||
| redis-py >= 7.1.0. |
|
🚀 PR was released in |

Adds ft.hybrid support to SQL query.
This ships as part of sql-redis 0.7.0 release.
Note
Medium Risk
Introduces a new search path (FT.HYBRID) behind stricter Redis/redis-py/sql-redis version requirements; incorrect docs or dependency pins could mislead adopters, but runtime code changes are minimal.
Overview
Documents SQL hybrid search via
hybrid_vector_search(cosine_distance(...), fulltext(...), rrf()|linear()), which maps to RedisFT.HYBRIDthrough the upgradedsql-redisdependency (now>=0.7.1inpyproject.tomland the lockfile).Coverage spans the
SQLQuerydocstring, API/concepts docs, and a new notebook section with an executable example. Integration tests exercise RRF and linear fusion,WHEREfilters, RRF knobs,redis_query_string()output, and asyncAsyncSearchIndex—all gated on Redis 8.4+ and redis-py >= 7.1.0.No new RedisVL translation logic in this PR; behavior comes from sql-redis 0.7.x on the existing
SQLQuery→index.query()path.Reviewed by Cursor Bugbot for commit 1e5bad8. Bugbot is set up for automated code reviews on this repo. Configure here.